//
//  UIView+RBAdd.h
//  GXSign
//
//  Created by 蓝其 on 16/11/15.
//  Copyright © 2016年 GX. All rights reserved.
//

#import <UIKit/UIKit.h>
#import "UIView+RBZoom.h"
#import "UIView+RBLayout.h"

//IB_DESIGNABLE 直接作用于系统视图,实时显示不友好,需要继承,就不打开了,运行起来不影响
@interface UIView(RBAdd)

- (void)rbSetCornerRadius: (CGFloat)value;
- (void)rbSetCorner:(UIRectCorner)corner radius:(CGFloat)radius;
- (void)setRounderWithRectCorner:(UIRectCorner)rectCorner radius:(CGFloat)radius;
- (void)rbSetBorderWitdh: (CGFloat)width borderColor: (UIColor *)color;
- (void)rbAddTapGesWithTarget:(id)target action:(SEL)action;
- (void)rbRemoveAllGes;

@property(nonatomic, strong)IBInspectable UIColor *borderColor;
@property(nonatomic, assign) IBInspectable CGFloat borderWidth;
@property(nonatomic, assign) IBInspectable CGFloat cornerRadius;
//扩大点击范围的数值
@property(nonatomic, assign) IBInspectable CGFloat extendResponseAreaValue;

/** 附加一个数据 */
@property(nonatomic, strong) id rbExData;

- (void)hideSubViews;
- (void)showSubViews;

/** 取nib */
+ (instancetype)view;
/** 生成一个模糊视图 */
+ (UIView *)blurView;
/** 生成渐变视图
 * locations:每个颜色对应的点（0-1）,和colors数量相同，可以为nil
 * vertical YES:从上到下 NO:从左到右
 */
+ (CAGradientLayer *)gradientLayerWithColors: (NSArray *)colors locations:(NSArray *)locations vertical: (BOOL)vertical;

- (void)setResponseArea:(UIEdgeInsets)area;
- (void)extendResponseArea;

- (void)addPriority: (NSInteger)add;
- (void)addVPriority: (NSInteger)add;
- (CGSize)esSize;
- (CGSize)esSizeWithWidth: (CGFloat)width;

@end

@interface UIView(RBHud)

- (void)showProgressWithText: (NSString *)text;
- (void)showProgressWithText: (NSString *)text offsetY: (CGFloat)offsetY;
- (void)showProgressWithText: (NSString *)text underView: (UIView *)view;
- (void)showTip: (NSString *)tip completion: (void(^)(void))block;
- (void)showTip: (NSString *)tip delay: (CGFloat)delayTime completion: (void(^)(void))block;
- (void)hideHud;

@end

@interface UIView(RBBackBtn)

/**
 默认图片backArror.png
 点击后只做pop操作,dismiss自行覆盖处理
 */
- (void)addBackBtn;
- (void)addBackBtnWithWidth: (CGFloat)width image: (UIImage *)image;
- (UIButton *)getBackBtn;

@end

@interface UIView(RBPlaceHolder)

/** 空数据时候显示 */
- (void)showPlaceHolder: (NSString *)placeHolder tapBlock: (void(^)(void))block;
- (void)showPlaceHolder:(NSString *)placeHolder textColor: (UIColor *)textColor top: (CGFloat)top tapBlock:(void (^)(void))block;

/** 隐藏 */
- (void)hidePlaceHolder;

@end

@interface UIView(Animation)

/** (删除)持续左右摇动 */
- (void)addShakeAnimation;
- (void)removeShakeAnimation;

/** (点击)单次缩放 */
- (void)addTapZoomAnimation;
/** (点击)多次缩放 */
- (void)addTapMultipleZoomAnimation;
/** 快速小幅缩放 */
- (void)addLittleZoomAnimation;
/** (点击)持续缩放 */
- (void)addTapContinuousZoomAnimation;
- (void)removeTapContinuousZoomAnimation;

@end

